package com.chuangjiangx.member.basic.ddd.dal.mapper;

import com.chuangjiangx.member.basic.ddd.dal.dto.*;
import com.chuangjiangx.member.basic.ddd.query.condition.MemberVolumeCondition;
import com.chuangjiangx.member.basic.ddd.query.condition.MemberVolumeDetailCondition;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

public interface MemberCountDalMapper {

    /**
     * 会员量详情
     */
    List<MemberVolumeDetail> queryMemberVolumeListWithRowBounds(MemberVolumeDetailCondition condition, RowBounds rowBounds);


    /**
     * 统计每天会员量
     */
    List<DateTimeMemberVolume> getDayCountListWithRowBounds(MemberVolumeCondition condition, RowBounds rowBounds);


    /**
     * 统计所有会员
     */
    int getTotalCount(@Param(value = "merchantId") Long merchantId);

    /**
     * 统计某段时间段的所有会员
     */
    int getTimeCount(MemberVolumeCondition condition);

    /**
     * 每小时统计一次会员量
     */
    List<DateTimeMemberVolume> getHourCountListWithRowBounds(MemberVolumeCondition condition, RowBounds rowBounds);

    /**
     * 按TOP10门店统计某个时间段会员量
     */
    List<StoreMemberVolume> getTop10StoreCountList(MemberVolumeCondition condition);

    /**
     * 按门店统计某个时间段会员量
     */
    List<StoreMemberVolume> getStoreCountListWithRowBounds(MemberVolumeCondition condition, RowBounds rowBounds);

    /**
     * 按照终端类型统计某个时间段会员量
     */
    List<TerminalMemberVolume> getTerminalCountListWithRowBounds(MemberVolumeCondition condition, RowBounds rowBounds);

    /**
     * 查询所有的门店以及模糊查询
     */
    List<StoreNameForList> queryAllStoreName(@Param(value = "storeName") String storeName, @Param(value = "merchantId") Long merchantId);

}
